1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to image encoding and decoding, and more particularly, to an image encoding method and apparatus and an image decoding method and apparatus capable of canceling a correlation remaining in a residual image by predicting the residual image by using residual neighboring pixel values of a current block and then encoding only the difference between the residual image and the predicted residual image, where the residual image is obtained using an inter color compensation algorithm that predicts a color component image from among a plurality of color component images constituting an image by using one of the remaining color component images.
2. Description of the Related Art
In general, color images are originally obtained in an RGB color format. Also, an RGB color image is encoded by transforming the format of the image into a color format, such as a YUV (or YCbCr) color format. Here, Y stands for a luminance component, and U (or Cb) and V (or Cr) stand for chrominance components. In the case of an RGB image, information is evenly distributed in all R, G and B components thereof. However, in the case of a YUV (or YCbCr) image, most information is contained in the Y component and less information is contained in the U (or Cb) and V (or Cr) components. Thus, the compression efficiency of a YUV (or YCbCr) image is high. In order to further improve the compression efficiency, the U (or Cb) and V (or Cr) components of the YUV (or YCbCr) image, which are chromaticity components, are sampled to a quarter of their original size in order to obtain a YUV (or YCbCr) 4:2:0 image.
However, if the U (or Cb) and V (or Cr) components are sampled to a quarter of the original size, color distortion occurs in the YUV (or YCbCr) 4:2:0 image, thereby preventing a high-quality image from being obtained. Accordingly, there is a need for a method of effectively encoding a YUV (or YCbCr) 4:4:4 image without sampling the U (or Cb) and V (or Cr) components thereof. Recently, Residual Color Transform (RCT) that is a technique for directly encoding an RGB 4:4:4 image has been introduced in order to remove color distortion occurring when an RGB image is transformed into the YUV (or YCbCr) format.
Coding efficiency is degraded when a conventional encoding method is applied in order to directly encode an image, such as a YUV (or YCbCr) 4:4:4 image or an RGB 4:4:4 image, which includes color components having the same resolution. Thus, when a YUV (or YCbCr) 4:4:4 image is encoded or an RGB image is encoded directly in an RGB domain without transforming the image into the YUV (or YCbCr) format, there is a need to develop a method of improving coding efficiency by performing prediction according to the statistical characteristics of the image while guaranteeing the high quality of the image.